package com.qfedu.electricpower.controller;

import com.qfedu.com.qianfeedu.result.Result;
import com.qfedu.electricpower.entity.TUser;
import com.qfedu.electricpower.service.TUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/login")
@RestController
public class LOgincontroller {

    @Resource
    private TUserService tUserService;

    @PostMapping("/login")
    public Result login(@RequestBody TUser user){
        String username = user.getUsename();
        if(username.equals("") || username == null){
            return Result.error(200001,"用户名或密码有误！");

        }
        this.tUserService.getByUsername(String username);

        return Result.ok();
    }

}
